<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Test dojox.Grid Basic</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        </meta>
        <style type="text/css">
            @import "../dojo/dojo-release-1.0.0/dojox/grid/_grid/tundraGrid.css";
            
            @import "../dojo/dojo-release-1.0.0/dijit/themes/tundra/tundra.css";
            
            @import "../dojo/dojo-release-1.0.0/dojo/resources/dojo.css";
            
        /*    body
            {
                font-size:0.9em;
                font-family:Geneva,Arial,Helvetica,sans-serif;            
            }
            .heading {
                font-weight: bold;
                padding-bottom: 0.25em;
            }
            
            #grid {
                border: 1px solid #333;
                width: 35em;
                height: 30em;
            }*/
        </style>
        <script type="text/javascript"
                src="../dojo/dojo-release-1.0.0/dojo/dojo.js"
                djConfig="isDebug:true, parseOnLoad: true,locale: 'zh-cn', extraLocale: ['zh-TW', 'fr']">
        </script>
        <script type="text/javascript">
            dojo.require("dojox.grid.Grid");
            dojo.require("dojox.grid._data.model");
            dojo.require("dojo.parser");
            dojo.require("dojo.i18n");
            dojo.require("dijit.form.TextBox");
            dojo.registerModulePath("my.app", "../../");
        </script>
        
        
        <script type="text/javascript" src="../../js/soapclient.js">
        </script>
        
        <!-- 
        <script type="text/javascript" src="test_data.js">
        </script> -->
        <script type="text/javascript">
            
            dojo.requireLocalization("my.app", "demo");
            var demoStr = dojo.i18n.getLocalization("my.app", "demo");
            //alert(demoStr.area);
            // a grid view is a group of columns
            var view1 = {
                cells: [
                    
                    [{name: demoStr.area}, {name: demoStr.placeName},{name: demoStr.postCode}, {name: demoStr.province}], 
                    [ {name: demoStr.remark,  colSpan: 4}]
                ]
            };
            // a grid layout is an array of views.
            var layout = [view1];
            
            // some sample data
            // global var "data"
            data = [["t","w","x","q","z"]];
            
            var url = "http://localhost:8080/logistics-ws/services/BasicManageService";
            
            //var url = "/logistics-ws/services/BasicManageService";
            
            //var com={name:"cw", age:"20"};
            //var p1 = new SOAPClientParameters();
            //p1.add("test",com);
            //var p2 = new SOAPClientParameters2();
            //p2.add("test",com);
            //alert(p1.toXml());
            //alert(p2.toXml());
            
            var pl = new SOAPClientParameters();
            
            SOAPClient.invoke(url, "getAllPlacevo", pl, false,  function GetUsers_callBack(ul, soapResponse){
                
                ul=ul.out;
                
                for(var i = 0; i < ul.length; i++){		
                    var items = new Array();
                    items[0] = ul[i].area;
                    items[1] = ul[i].placeName;
                    items[2] = ul[i].postCode;
                    items[3] = ul[i].province;
                    items[4] = ul[i].remark;
                    data[i]=items;
                }
                //alert(soapResponse.xml);
                
            });
            
            // global var "model"
            var model = new dojox.grid.data.Table(null, data);
            var l=document.getElementsByName("label_area");//.setText(demoStr.area);
            for(var t in l){
                console.debug(t);
            }
            //console.debug(("inputarea"+dojo.byId("inputarea")+document.getElementById("inputarea")));//.value=demoStr.area;
            //dojo.byID('grid').refresh();
        </script>
    </head>
    <body class="tundra">
        <form>
            <div class="heading">dojox.Grid Basic Test</div>
            
            
            <label id="label_area" name="label_area"  for="input_area"> <script>document.write(demoStr.area)</script></label>
            <input id="input_area" type="text" name="input_area" value="testing testing"
                   dojoType="dijit.form.TextBox"
                   trim="true"
                   propercase="true" />
            
            <div id="grid" dojoType="dojox.Grid" model="model" structure="layout">
            </div>
            
            <div id="rowCount" name="rowCount" ></div>
        </form>            
    </body>
</html>
